<?php
  $uri_segment = $this->uri->segment(3);
  if($uri_segment != "" && $uri_segment != "all"){
      $option = parsing_param2($uri_segment);
      $awal = datefmysql($option['awal']);
      $akhir = datefmysql($option['akhir']);
  }else{
      $awal = date('d/m/Y');
      $akhir = date('d/m/Y');
  }
?>
<html>
    <head>
        <title>Cetak Laporan Collecting Day</title>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/style2.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/tabel.css" />
        <script type="text/javascript">
                function cetak() {
                        SCETAK.innerHTML = '';
                        window.print();
                        if (confirm('Apakah menu print ini akan ditutup?')) {
                                window.close();
                        }
                        SCETAK.innerHTML = '<br /><input onClick=\'cetak()\' type=\'submit\' name=\'Submit\' value=\'Cetak\' class=\'tombol\'>';
                }

        </script>
    </head>
    <body>
        <center>
            <h1>Laporan Collecting Day</h1>
            <h2>Periode <?php echo indo_tgl($awal)?> s.d <?php echo indo_tgl($akhir)?></h2>
        </center>
        <div class="data-list">
           <table class="tabel" style="width: 100%">
                <tr>
                    <th>No</th>
                    <th>Kegiatan</th>
                    <th>Tanggal</th>
                    <th>Petugas</th>
                    <th>Lokasi</th>
                    <th>Total (Rp.)</th>
                </tr>
                <?php
                    $offsets = isset ($offset)?$offset:0;
                    $no = 1 + $offsets;
                    foreach ($listCollectingDay as $row){
                ?>
                <tr class="<?php echo ($no%2)?"even":"odd";?>">
                    <td align="center" style="width: 5%"><?php echo $no++?></td>
                    <td><?php echo $row['kegiatan'];?></td>
                    <td><?php echo datefmysql($row['tanggal']);?></td>
                    <td><?php echo $row['member'];?></td>
                    <td><?php echo $row['lokasi'];?></td>
                    <td align="right"><?php echo rupiah($row['total']);?></td>
                </tr>
                <?php
                    }
                ?>
           </table>
        </div>
        <center><span id="SCETAK"><input type="button" class="tombol" value="Cetak" onClick="cetak()"/></span></center>
    </body>
</html>    
